import functools
def test1(func):
    def test2(*args,**kw):
        print("帮你把饭做好")
        ret = func(*args,**kw)
        print("洗碗")
        return ret
    return test2

# 装饰器
def a(*text):
    def b(func):
        @functools.wraps(func)
        def c(*args,**kw):
            if not text:
                pass
            else: print(text)
            print("before!")
            ret = func(*args,**kw)
            print("after")
            return ret
        return c
    return b

@a()
def run():
    print("I am running")


@test1
def eat():
    print("我在在吃饭")

eat()
run()







